Xbasic

SQL::QueryOpenConnection Method

Syntax

Result_Flag as L = OpenConnection(SQLConnectionString as C)

Arguments

Result_Flag

TRUE (.T.) if the operation was successful; otherwise FALSE (.F.).

SQL::Query

A SQL::Query object created with a DIM statement.

SQLConnectionString

Character

Description

Generate a native SQL statement using the selected syntax associated with the current or passed connection.

Discussion

The OpenConnection() method generates a native SQL statement in the SQL::Query.SQLStatement property using the selected syntax associated with the current or passed connection. After calling the OpenConnection() method, the object's .Connection property is a SQL::Connection object.

Example

dim qry as SQL::Query
dim connString as C
connString = "{A5API='Access', FileName='c:\program files\a5v7\mdbfiles\alphasports.mdb'}"
qry.parse("Select * from Customer")
? qry.OpenConnection(connString)
= .T.

See Also